From: Roger Pau Monne Date: Wed, 18 Sep 2013 11:15:14 +0000 (+0200) Subject: libxl: don't remove device frontend path from driver domains X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5945 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=51e20c55808cfe3e51b45f6ff2a45775170fa5e4;p=xen.git libxl: don't remove device frontend path from driver domains A domain different than LIBXL_TOOLSTACK_DOMID should not try to remove the frontend paths of a device. Signed-off-by: Roger Pau Monné Cc: Ian Campbell Acked-by: Ian Jackson --- diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index cce9e327dc..d5f23cfb40 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -551,6 +551,10 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device *dev) const char *tapdisk_params; xs_transaction_t t = 0; int rc; + uint32_t domid; + + rc = libxl__get_domid(gc, &domid); + if (rc) goto out; for (;;) { rc = libxl__xs_transaction_start(gc, &t); @@ -560,8 +564,20 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device *dev) rc = libxl__xs_read_checked(gc, t, tapdisk_path, &tapdisk_params); if (rc) goto out; - libxl__xs_path_cleanup(gc, t, fe_path); - libxl__xs_path_cleanup(gc, t, be_path); + if (domid == LIBXL_TOOLSTACK_DOMID) { + /* + * The toolstack domain is in charge for removing both the + * frontend and the backend path + */ + libxl__xs_path_cleanup(gc, t, fe_path); + libxl__xs_path_cleanup(gc, t, be_path); + } else if (dev->backend_domid == domid) { + /* + * The driver domain is in charge for removing what it can + * from the backend path + */ + libxl__xs_path_cleanup(gc, t, be_path); + } rc = libxl__xs_transaction_commit(gc, &t); if (!rc) break;